export function handIconPath(path) {
  switch (path) {
    case 'dayu':
    case 'zhongyu':
    case 'baoyu':
    case 'zhenyu':
      return 'dayu'
    case 'xiaoyu':
    case 'yu':
      return 'xiaoyu'
    // case 'yin':
    // case 'yun':
    //   return 'yin'

    case 'xiaoxue':
    case 'xue':
    case 'zhongxue':
      return 'xiaoxue'
    case 'daxue':
    case 'baoxue':
      return 'daxue'

    case 'wumai':
    case 'wu':
      return 'wumai'
  }

  return path
}

export function formatDateToText(dateStr) {
  // 创建日期对象
  const targetDate = new Date(dateStr)
  const today = new Date()

  // 标准化日期（仅比较年/月/日）
  const target = new Date(
    targetDate.getFullYear(),
    targetDate.getMonth(),
    targetDate.getDate()
  )
  const current = new Date(
    today.getFullYear(),
    today.getMonth(),
    today.getDate()
  )

  // 计算日期差（毫秒转天数）
  const timeDiff = target - current
  const dayDiff = Math.floor(timeDiff / (1000 * 60 * 60 * 24))

  // 定义星期文本
  const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']

  // 判断并返回对应文本
  if (dayDiff === 0) {
    return '今天'
  } else if (dayDiff === 1) {
    return '明天'
  } else {
    // 返回星期几
    return weekdays[target.getDay()]
  }
}
